<template>
    <div class="table-operator">
        <a-button shape="round" size="small" type="primary" icon="eye" @click="print(1)">打印预览</a-button>
        <a-button shape="round" size="small" type="primary" icon="setting" @click="print(3)">打印维护</a-button>
    </div>
</template>

<script>
import {getLodop} from '/public/static/clodop/LodopFuncs'
export default {
    name:'wxjjd',
    data(){
        return{
            LODOP:null,
        }
    },
    mounted(){
        this.$nextTick(() => {
          
        });
    },
    methods:{
        print(type){
            this.createOneFormPage()
            if(type==1){
                //打印预览

                //设置打印预览页面大小，如果不加则全屏
                this.LODOP.SET_PREVIEW_WINDOW(0,0,0,800,600,"");
                
                this.LODOP.PREVIEW()
            }else if(type==2){
                //直接打印
               this.LODOP.PRINT()
            }else if(type==3){
                //打印维护,免费用不了
                // this.createOneFormPage()
                this.LODOP.PRINT_SETUP()
            }
        },
        createOneFormPage(){
            //出库单
            //http://www.lodop.net/demolist/PrintSampleA1.html 通过此页面进行设计

            
            this.LODOP=getLodop()
            this.LODOP.SET_PRINT_MODE("RESELECT_PRINTER",true)//允许重选打印机
            this.LODOP.SET_PRINT_MODE("RESELECT_ORIENT",true)//允许重选纸张方向
            this.LODOP.SET_PRINT_MODE("RESELECT_PAGESIZE",true)//允许重选纸张
            this.LODOP.SET_PRINT_MODE("RESELECT_COPIES",true)//允许重选份数
            
            this.LODOP.ADD_PRINT_TEXT(37,3,567,37,'车辆维修交接单（代合同）');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',18);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.SET_PRINT_STYLEA(0,'Bold',1);
            this.LODOP.SET_PRINT_STYLEA(0,'Horient',2);
            this.LODOP.ADD_PRINT_TEXT(93,45,153,30,'承修单位：（盖章）');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.ADD_PRINT_TEXT(93,320,59,30,'地址：');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.ADD_PRINT_TEXT(93,520,100,30,'联系电话：');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.ADD_PRINT_TEXT(130,45,100,30,'送修单位：');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.ADD_PRINT_TEXT(130,320,59,30,'地址：');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.ADD_PRINT_TEXT(130,520,100,30,'联系电话：');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Horient',3);
            this.LODOP.ADD_PRINT_RECT(166,23,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(166,115,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(166,483,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(166,207,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(166,575,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(166,299,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(166,391,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(166,667,95,40,0,1);
            this.LODOP.ADD_PRINT_TEXT(179,26,88,20,'车牌号');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(166,207,90,40,'车辆识别\r\n代码');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(179,391,92,20,'送修单号');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(179,577,95,20,'维修类别');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_RECT(206,23,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(206,115,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(206,207,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(206,299,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(206,391,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(206,483,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(206,575,92,40,0,1);
            this.LODOP.ADD_PRINT_RECT(206,667,95,40,0,1);
            this.LODOP.ADD_PRINT_TEXT(222,24,90,20,'颜色');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(221,208,90,20,'进厂日期');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(222,389,95,20,'出厂日期');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(222,577,92,20,'付款方式');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_RECT(246,23,92,115,0,1);
            this.LODOP.ADD_PRINT_RECT(361,23,92,115,0,1);
            this.LODOP.ADD_PRINT_RECT(476,23,92,135,0,1);
            this.LODOP.ADD_PRINT_RECT(611,23,92,115,0,1);
            this.LODOP.ADD_PRINT_RECT(726,23,92,140,0,1);
            this.LODOP.ADD_PRINT_TEXT(252,23,90,105,'维\r\n修\r\n项\r\n目');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(364,23,90,110,'送\r\n车\r\n附\r\n记');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(613,23,90,104,'接\r\n车\r\n附\r\n记');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(477,24,90,125,'竣工\r\n车辆\r\n（总\r\n成）\r\n技术\r\n概况');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(732,23,90,130,'接\r\n车\r\n单\r\n位\r\n意\r\n见');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_RECT(866,23,92,48,0,1);
            this.LODOP.ADD_PRINT_TEXT(881,25,83,27,'交车人');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_RECT(866,115,92,48,0,1);
            this.LODOP.ADD_PRINT_RECT(866,207,92,48,0,1);
            this.LODOP.ADD_PRINT_RECT(866,299,100,48,0,1);
            this.LODOP.ADD_PRINT_TEXT(881,206,90,28,'接车人');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_RECT(866,399,92,48,0,1);
            this.LODOP.ADD_PRINT_RECT(866,491,92,48,0,1);
            this.LODOP.ADD_PRINT_RECT(866,583,92,48,0,1);
            this.LODOP.ADD_PRINT_RECT(866,675,87,48,0,1);
            this.LODOP.ADD_PRINT_TEXT(881,403,85,25,'承办人');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_TEXT(881,588,92,30,'监修人');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.SET_PRINT_STYLEA(0,'Alignment',2);
            this.LODOP.ADD_PRINT_RECT(246,115,647,115,0,1);
            this.LODOP.ADD_PRINT_RECT(361,115,647,115,0,1);
            this.LODOP.ADD_PRINT_RECT(476,115,647,135,0,1);
            this.LODOP.ADD_PRINT_RECT(611,115,647,115,0,1);
            this.LODOP.ADD_PRINT_RECT(726,115,647,140,0,1);
            this.LODOP.ADD_PRINT_TEXT(936,95,482,30,'说明：本表一式三份，送修单位、承修单位和监修机构各一份');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.ADD_PRINT_TEXT(180,117,84,20,'豫A220E7');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',10);
            this.LODOP.ADD_PRINT_TEXT(169,302,90,35,'LNYGH8BD5321600564');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',10);
            this.LODOP.ADD_PRINT_TEXT(180,484,88,20,'送修单号录入');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',10);
            this.LODOP.ADD_PRINT_TEXT(180,668,88,20,'维修类别录入');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',10);
            this.LODOP.ADD_PRINT_TEXT(223,117,80,20,'颜色录入');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',10);
            this.LODOP.ADD_PRINT_TEXT(223,302,80,20,'2023-12-15');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',10);
            this.LODOP.ADD_PRINT_TEXT(223,490,80,20,'2023-12-23');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',10);
            this.LODOP.ADD_PRINT_TEXT(94,197,115,20,'7438GC');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            this.LODOP.ADD_PRINT_TEXT(94,377,130,20,'五十洪山路1225号');
            this.LODOP.SET_PRINT_STYLEA(0,'FontSize',12);
            

            //二维码（TOP,LEFT,WIDTH,HEIGHT）
           // this.LODOP.ADD_PRINT_BARCODE(10,50,150,150,"QRCode","11111");
        },
        printContent(hTextTop){
         LODOP.ADD_PRINT_TEXT(hTextTop,31,100,20,"1名称1111111");
        LODOP.ADD_PRINT_TEXT(hTextTop,181,50,20,"1单位");
        LODOP.ADD_PRINT_TEXT(hTextTop,231,50,20,"1数量");
        LODOP.ADD_PRINT_TEXT(hTextTop,281,258,20,"1原因");
        LODOP.ADD_PRINT_TEXT(hTextTop,539,100,20,"1规格");
    }
    },
    

}
</script>